package com.spring;

public class DestroyMethodInfo {
    private final Runnable destroyAction;

    public DestroyMethodInfo(Runnable destroyAction) {
        this.destroyAction = destroyAction;
    }

    public Runnable getDestroyAction() {
        return destroyAction;
    }

    public void executeDestroy() throws Exception {

        destroyAction.run(); // 调用封装的销毁逻辑（如userService.destroy()）
    }
}